#!/bin/bash

if [ "$#" -ne 2 ]; then
    echo "Usage: $0 <local_path> <remote_path>"
    exit 1
fi

LOCAL_PATH=$1
REMOTE_PATH=$2

REMOTE_USER="lighthouse"
REMOTE_HOST="111.229.30.135"

REMOTE_FULL_PATH="${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_PATH}"

scp -i ~/.ssh/tencent -r "$LOCAL_PATH" "$REMOTE_FULL_PATH"

if [ $? -eq 0 ]; then
    echo "File transfer completed successfully."
else
    echo "File transfer failed."
    exit 1
fi
